package com.lollipop.synthential.java8.lambda.syntax;

import com.lollipop.synthential.java8.lambda.syntax.data.Person;

/**
 * @Author: J.K
 * @Date: 2021-02-15 20:44
 * @Description:
 */
public class Syntax4 {
    public static void main(String[] args) {
        PersonCreater creater = () -> new Person();

        // 构造方法的引用：
        PersonCreater creater1 = Person::new;
        Person a = creater1.getPerson();

        PersonCreater2 creater2 = Person::new;
        Person b = creater2.getPerson("雯雯", 28);
    }
}

// 需求：
interface PersonCreater {
    Person getPerson();
}

interface PersonCreater2 {
    Person getPerson(String name, int age);
}
